home *** CD-ROM | disk | FTP | other *** search
- Sub CenterForm (frm As Form)
- frm.Left = (Screen.Width - frm.Width) / 2
- frm.Top = (Screen.Height - frm.Height) / 2
- End Sub
-
- Function UtilsNewFile (msg As String, fileid As String, extension As String)
- On Error GoTo NewFileError
- Utils.CMDialog.CancelError = True
- Utils.CMDialog.Flags = OFN_OVERWRITEPROMPT
- Utils.CMDialog.DefaultExt = extension
- Utils.CMDialog.DialogTitle = msg + " " + fileid + " File..."
- Utils.CMDialog.Filter = fileid + " files|*." + extension
- Utils.CMDialog.Action = 2 ' save file
- UtilsNewFile = LCase$(Utils.CMDialog.Filetitle)
- Exit Function
- NewFileError:
- UtilsNewFile = ""
- Exit Function
- End Function
-
- Function UtilsOpenFile (msg As String, fileid As String, Filter As String)
- On Error GoTo OpenFileError
- Utils.CMDialog.CancelError = True
- Utils.CMDialog.Flags = OFN_FILEMUSTEXIST
- Utils.CMDialog.DefaultExt = extension
- Utils.CMDialog.DialogTitle = msg + " " + fileid + " File..."
- Utils.CMDialog.Filter = Filter
- Utils.CMDialog.Action = 1 ' open file
- UtilsOpenFile = LCase$(Utils.CMDialog.Filetitle)
- Exit Function
- OpenFileError:
- UtilsOpenFile = ""
- Exit Function
- End Function
-
- Function ExtractBase (ByVal PathName As String) As String
-
- ' Return the basename portion of a full pathname
-
- F$ = ExtractFile(PathName)
- N% = InStr(F$, ".")
-
- If N% > 0 Then F$ = Left$(F$, N% - 1)
-
- ExtractBase = F$
-
- End Function
-
- Function ExtractFile (ByVal PathName As String) As String
-
- ' Return the filename portion of a full pathname
-
- F$ = PathName
-
- Do
- N% = InStr(F$, "\")
- If N% > 0 Then F$ = Right$(F$, Len(F$) - N%)
- Loop While N% > 0
-
- ExtractFile = F$
-
- End Function
-
- Function ExtractPath (ByVal PathName As String) As String
-
- ' Return the directory path portion of a full pathname
-
- F$ = PathName
-
- Do
- N% = InStr(F$, "\")
- If N% > 0 Then F$ = Right$(F$, Len(F$) - N%)
- Loop While N% > 0
-
- ExtractPath = Left$(PathName, Len(PathName) - Len(F$))
-
- End Function
-